<!DOCTYPE html>
<html lang="en">
	<head>
		<title>米迪</title>
		<meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link rel="stylesheet" href="__Admin__/css/bootstrap.min.css" />
		<link rel="stylesheet" href="__Admin__/css/bootstrap-responsive.min.css" />
		<link rel="stylesheet" href="__Admin__/css/uniform.css" />
		<link rel="stylesheet" href="__Admin__/css/select2.css" />		
		<link rel="stylesheet" href="__Admin__/css/unicorn.main.css" />
		<link rel="stylesheet" href="__Admin__/css/base.css" />
		<link rel="stylesheet" href="__Admin__/css/unicorn.grey.css" class="skin-color" />	
        <script type="text/javascript" src="__Admin__/js/jquery-1.7.min.js"></script>
        <script type="text/javascript"  src="__Admin__/js/dsdialog.js"></script>
        <script type="text/javascript">
            ;(function(){
            	 jQuery(function () {
     	        	jQuery("#mytable").find("td").delegate("span.og", "click", function(){
     				       	var id=jQuery(this).attr("func");
     				     	$.post("__URL__/getscore",  {"openid":id}, function(myret){
     				     		 var jsonRet=$.parseJSON(myret);
     				     		 var content="";
     			  				if(!jsonRet.ret){
     			  				   for(i=0;i<jsonRet.data.length;i++){
     			  					 var a="<tr><td>"+jsonRet.data[i].openid+"</td>"+
									"<td>"+jsonRet.data[i].score+"</td>"+
									"<td>"+jsonRet.data[i].scoretype+"</td>"+
									"<td>"+jsonRet.data[i].times+"</td></tr>";
     			  					content+=a;
     			  				   }
     			  				}else{
     			  					content+="<tr><td colspan='4'>暂无积分记录</td></tr>";
     			  				}
	     				       	var html=$("#jifenmingxie");
	     				       	var mycontent=html.show().find("table").css({"width":"600px","height":"auto"}).find("#mingxie").append(content).parents("#jifenmingxie").html();
	     				  		ds.dialog({
	     				  		   title : '积分明细',
	     				  		   content : mycontent,
	     				  		   //yesText : '保存',
	     					       //onyes:function(){},
	     					       noText : '取消',
	     					       onno : function(){
	     					    	  html.hide().find("#mingxie").html("");
	     						      this.close();
	     					      },
	     				  		  icon : "__Admin__/img/success.png",
	     				  		});
     				     	});
     			        });
     	           
     	        	//添加到白名单
     	        	jQuery("#mytable").find("td").delegate("span.ok", "click", function(){
     	        	 	var id=jQuery(this).attr("func");
 				     	$.post("__URL__/baimingdan",  {"openid":id}, function(myret){
 				     		 var jsonRet=$.parseJSON(myret);
 				     		if(!jsonRet.ret){
 				     			  alert(jsonRet.message);
 				     			 location.reload() ;
 				     		}else{
 				     			alert(jsonRet.message);
 				     		}
     	        	   });
     	          });
            	 });
            })();
    </script>
	    </head>
	<body>
		<include file="Public/head" />
		
		<div id="content">
			<div id="content-header">
				<h1 id="ogh">用户管理</h1>
			</div>
			<div id="breadcrumb">
				<a href="#" class="current">用户列表</a>
			</div>
			<div class="container-fluid">
				<div class="row-fluid">
					<div class="span12">
						<div class="widget-box">
							<div class="widget-title">
								<span class="icon">
									<i class="icon-th"></i>
								</span>
								<h5>用户列表</h5>
							</div>	
							<div id="jifenmingxie" style="display:none;">
								<div class="widget-content nopadding" id="alert">
								 <table class="table table-bordered table-striped">
										<thead >
											<tr>																
												<th>openid</th>
												<th>积分</th>
												<th>积分类型</th>
												<th>时间</th>
											</tr>
										</thead>
										<tbody id="mingxie"></tbody>
									</table>  
								</div>
							</div>
							<div class="widget-content nopadding">
								<table class="table table-bordered table-striped" id="mytable">
									<thead>
										<tr>
										    <th>编号</th>															
											<th>IP</th>
											<th>城市</th>		
											<th>名称</th>
											<th>积分</th>
											<th>注册时间</th>
											<th>上线id</th>
											<th>上线名</th>
											<th>操作</th>
										</tr>
									</thead>
									<tbody>
									<volist name="list" id="vo">
										<tr>
										    <td>{$vo.uid}</td>									
											<td>{$vo.ip}</td>
											<td>{$vo.city}</td>									
											<td>{$vo.uname}</td>
											<td>{$vo.score}</td>
											<td>{$vo.times}</td>
											<td></td>
											<td>{$vo.shangxianname}</td>											
											<td>
											<span class="ok" func="{$vo.openid}">白名单</span>
											<span><a href="{:U('Client/update',array('id'=>$vo['uid']))}">拉黑</a></span>
											<span func="{$vo.openid}" class="og" style="width:40px;">积分</span>
											</td>
										</tr>
										</volist>
									</tbody>
								</table>  
								<div style="float:right; margin:20px 30px; font-size:18px;">{$page}</div> 								
							</div>	
						</div>
					</div>
				</div>			
			</div>
		</div>
		    <script src="__Admin__/js/jquery.js"></script>
            <script src="__Admin__/js/jquery.ui.custom.js"></script>
            <script src="__Admin__/js/bootstrap.min.js"></script>
            <script src="__Admin__/js/jquery.uniform.js"></script>
            <script src="__Admin__/js/select2.min.js"></script>
            <script src="__Admin__/js/jquery.dataTables.min.js"></script>
            <script src="__Admin__/js/unicorn.js"></script>
            <script src="__Admin__/js/unicorn.tables.js"></script>
	</body>
</html>
